const path = require("path"); //引入path模块
function resolve(dir) {
    return path.join(__dirname, dir); //path.join(__dirname)设置绝对路径
}
module.exports = {
    devServer: {
        //跨域
        publicPath: '/',
        host: "",
        open: true,
        proxy: {
            "/api": {
                target: " http://39.107.243.107:3000/",
                changeOrigin: true,
                pathRewrite: { "^/api": "/api" },
            },
        },
        
    },
    configureWebpack: (config) => {
        // 取消console打印    
        config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true
    },
    
    chainWebpack: (config) => {
        //配置路径别名
        config.resolve.alias.set("views", resolve("./src/views"));
        config.resolve.alias.set("components", resolve("./src/components"));     
        config.resolve.alias.set("assets", resolve("./src/assets"));
    },
};